<div class="new-post-form align-center">
    <h2><?= $this->__("Edit"); ?></h2>
    <form action="" method="POST" id="login"  class="nomoderation noexpand">

        <div class="error autohide" style="display: <?= ($this->error) ? '' : 'none' ?>;"><?= ($this->error) ? $this->error : '' ?></div>

        <div>
            <label for="category"><?= $this->__("Category"); ?></label>
            <select id="category" name="category" required="required">
                <option value=""></option>
                <?php foreach($this->categories as $cat): ?>
                <option value="<?= $cat['name_en']; ?>" <?= ($this->post['category_en'] == $cat['name_en']) ? 'selected' : '' ?> >
                        <?= $cat['name_'.\Lib\Registry::get('trans')->getLocale()]; ?>
                </option>
                <?php endforeach; ?>
            </select>
        </div>

        <div>
            <label for="title"><?= $this->__("Title"); ?></label>
            <input type="text" id="title" name="title" required="required" size="255" value="<?= $this->post['title'] ?>" >
        </div>
        
        <div>
            <label for="title"><?= $this->__("Tags"); ?></label>
            <input type="text" id="tags" name="tags" size="255"  placeholder="<?= $this->__("Enter tags, separated by commas"); ?>"  value="<?= $this->post['tags'] ?>" >
        </div>
        
        <div>
            <label for="description"><?= $this->__("Description"); ?></label>
            <textarea type="text" id="description" name="description" rows="8" cols="100"  value="<?= $this->post['description'] ?>" >
                <?= $this->post['description'] ?>
            </textarea>
        </div>
        
        <div>
            <label for="text"><?= $this->__("Text"); ?></label>
            <textarea id="text" name="text" required="required" rows="10" cols="100" >
                <?= stripslashes($this->post['post']) ?>
            </textarea>
        </div>

        <a href="/post/<?= $this->post['id']; ?>">Назад</a>
        <input type="submit" value="<?= $this->__("Save"); ?>" class="btn btn-success">

    </form> 
</div>